$(document).ready(function() {

	//
	// Development Tools Sidebar
	//
	$('div#develop_tools').css('display', 'block');

	if ($('#develop_tools_db_sync_result').length) {
		$('div#develop_tools_contents').css('display', 'block');
		$('div#develop_tools_db_contents').css('display', 'block');
	}

	$('div#develop_tools_toggle').click(function() {
		if ($('div#develop_tools_db_contents').css('display') == 'block')
			$('div#develop_tools_db_contents').toggle();

		$('div#develop_tools_contents').toggle('slow');
	});

	$('div#develop_tools #db_sync_good, div#develop_tools #db_sync_bad, div#develop_tools #db_sync_result').click(function() {
		$('div#develop_tools_db_contents').toggle('slow');
	});

	//Open validation tools in new windows
	$('#develop_tools_contents #validate_html, #develop_tools_contents #validate_css').click(function() {
		window.open(this.href);
		return false;
	});

	//Blueprint integration
	$('#develop_tools_contents #enable_blueprint_grid').click(function() {
			$('.container').toggleClass('showgrid');
	});

	//Make the Display Tools show up only if Javascript is enabled in the browser.
	$('#develop_tools_toggle').css('display', 'block');

});